﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using IrrlichtLime.Core;
using IrrlichtLime.IO;
using IrrlichtLime.Video;

namespace BillardPHS4700 {

    class Constants {

        /// <summary>
        /// Initializes constants that require special initialization code
        /// </summary>
        static Constants() {

            BallInertia = new Matrix();
            BallInertia.SetElement(0, 0, 2 * BallWeight * BallRadius * BallRadius / 5);
            BallInertia.SetElement(0, 1, 0);
            BallInertia.SetElement(0, 2, 0);
            BallInertia.SetElement(1, 0, 0);
            BallInertia.SetElement(1, 1, 2 * BallWeight * BallRadius * BallRadius / 5);
            BallInertia.SetElement(1, 2, 0);
            BallInertia.SetElement(2, 0, 0);
            BallInertia.SetElement(2, 1, 0);
            BallInertia.SetElement(2, 2, 2 * BallWeight * BallRadius * BallRadius / 5);
        }

        /// <summary>
        /// Physical radius of balls in centimeters
        /// </summary>
        public static readonly float BallRadius = 5.7f / 2;
        /// <summary>
        /// Physical weight of the balls in kg
        /// </summary>
        public static readonly float BallWeight = 0.18f;

        ///<summary>
        ///Inertia Matrix of a ball
        ///</summary>
        public static Matrix BallInertia { get; private set; }

        /// <summary>
        /// Length of the cue stick in meters
        /// </summary>
        public static readonly float CueStickLength = 1.3f;

        /// <summary>
        /// Physical Weight of the CueStick in kg
        /// </summary>
        public static readonly float CueStickWeight = 0.6f;

        /// <summary>
        /// Height of the light source
        /// </summary>
        public static readonly float LightHeight = 1.25f * 100f;


        public static readonly float TopWallY = 60f;
        public static readonly float BottomWallY = -60f;
        public static readonly float LeftWallX = 120f;
        public static readonly float RightWallX = -120f;

        /// <summary>
        /// Height of the table
        /// </summary>
        public static readonly float TableHeight = 0.75f;

        public static readonly float LinearFriction = 0.2f;

        public static readonly float RotationFriction = 0.01f;

        public static readonly double v_Min = 120/Math.Sqrt(Math.Pow(Math.E,10/0.587));

        public static readonly float InertieBall = 2 * Constants.BallWeight * Constants.BallRadius * Constants.BallRadius / (5 * 100 * 100); //in international metric system

    }
}
